import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';

@Entity('permissions_control')
export class PermissionControlEntity {

  @PrimaryGeneratedColumn()
  id;

  @Column({
    name: 'permission_control',
    type: 'enum',
    enum: ['yes', 'no'],
  })
  permissionControl = 'no';

  @Column({
    name: 'role_id',
  })
  roleId: number;

  @Column({
    name: 'permission_id',
  })
  permissionId: number;

  @Column({
    name: 'deleted_at',
    type: 'datetime',
    nullable: true,
    select: false,
  })
  deletedAt;

  @CreateDateColumn({
    name: 'created_at',
  })
  createAt;

  @UpdateDateColumn({
    name: 'updated_at',
  })
  updatedAt;
}
